home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Revolution - Das Atari CD Magazin 1997
/
Revolution - Das Atari CD Magazin 1.iso
/
software
/
anwendng
/
qed_397
/
sourcen
/
magx.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-12-29
|
4KB
|
158 lines
/*
* magx.c: einige Fuktionen für MagiC
*/
#include "global.h"
#include "magx.h"
/*
* Für neue AES-Calls
*/
EXTERN AESPB AES_pb;
/*
* Der MagX-Cookie
*/
typedef struct
{
BYTE *in_dos; /* Adresse der DOS- Semaphore */
WORD *dos_time; /* Adresse der DOS- Zeit */
WORD *dos_date; /* Adresse des DOS- Datums */
LONG res1;
LONG res2;
LONG res3;
VOID *act_pd; /* Laufendes Programm */
LONG res4;
WORD res5;
VOID *res6;
VOID *res7; /* interne DOS- Speicherliste */
VOID (*resv_intmem)(); /* DOS- Speicher erweitern */
LONG (*etv_critic)(); /* etv_critic des GEMDOS */
BYTE * ((*err_to_str)(BYTE e)); /* Umrechnung Code->Klartext */
LONG res8;
LONG res9;
LONG res10;
} DOSVARS;
typedef struct
{
LONG magic; /* muß $87654321 sein */
VOID *membot; /* Ende der AES- Variablen */
VOID *aes_start; /* Startadresse */
LONG magic2; /* ist 'MAGX' */
LONG date; /* Erstelldatum ttmmjjjj */
VOID (*chgres)(WORD res, WORD txt);/* Auflösung ändern */
LONG (**shel_vector)(VOID); /* residentes Desktop */
BYTE *aes_bootdrv; /* von hieraus wurde gebootet */
WORD *vdi_device; /* vom AES benutzter VDI-Treiber */
VOID *reservd1;
VOID *reservd2;
VOID *reservd3;
WORD version; /* z.B. $0201 ist V2.1 */
WORD release; /* 0=alpha..3=release */
} AESVARS;
typedef struct
{
LONG config_status;
DOSVARS *dosvars;
AESVARS *aesvars;
} MAGX_COOKIE;
GLOBAL WORD check_magx(VOID)
{
LONG v;
MAGX_COOKIE *magxCook;
WORD version;
if (getcookie('MagX', &v))
{
magxCook = (MAGX_COOKIE *)v;
version = magxCook->aesvars->version;
}
else
version = 0;
return version;
}
/*
* Zeichensatzauswahl
*/
GLOBAL VOID *fnts_create(WORD handle, WORD no_fonts, WORD font_flags,
WORD dialog_flags, UBYTE *sample, UBYTE *opt_button)
{
_GemParBlk.contrl[0] = 180;
_GemParBlk.contrl[1] = 4;
_GemParBlk.contrl[2] = 0;
_GemParBlk.contrl[3] = 2;
_GemParBlk.contrl[4] = 1;
_GemParBlk.intin[0] = handle;
_GemParBlk.intin[1] = no_fonts;
_GemParBlk.intin[2] = font_flags;
_GemParBlk.intin[3] = dialog_flags;
_GemParBlk.addrin[0] = sample;
_GemParBlk.addrin[1] = opt_button;
_crystal(&AES_pb);
return _GemParBlk.addrout[0];
}
GLOBAL WORD fnts_delete(VOID *fnt_dialog, WORD handle)
{
_GemParBlk.contrl[0] = 181;
_GemParBlk.contrl[1] = 1;
_GemParBlk.contrl[2] = 1;
_GemParBlk.contrl[3] = 1;
_GemParBlk.contrl[4] = 0;
_GemParBlk.intin[0] = handle;
_GemParBlk.addrin[0] = fnt_dialog;
_crystal(&AES_pb);
return _GemParBlk.intout[0];
}
GLOBAL WORD fnts_do(VOID *fnt_dialog, WORD button_flags, LONG id_in, LONG pt_in,
LONG ratio_in, WORD *check_boxes, LONG *id, LONG *pt, LONG *ratio)
{
_GemParBlk.contrl[0] = 187;
_GemParBlk.contrl[1] = 7;
_GemParBlk.contrl[2] = 8;
_GemParBlk.contrl[3] = 1;
_GemParBlk.contrl[4] = 0;
_GemParBlk.intin[0] = button_flags;
_GemParBlk.intin[1] = (UWORD)(id_in >> 16);
_GemParBlk.intin[2] = (UWORD)(id_in);
_GemParBlk.intin[3] = (UWORD)(pt_in >> 16);
_GemParBlk.intin[4] = (UWORD)(pt_in);
_GemParBlk.intin[5] = (UWORD)(ratio_in >> 16);
_GemParBlk.intin[6] = (UWORD)(ratio_in);
_GemParBlk.addrin[0] = fnt_dialog;
_crystal(&AES_pb);
*check_boxes = _GemParBlk.intout[1];
*id = ((LONG)_GemParBlk.intout[2] << 16) | _GemParBlk.intout[3];
*pt = ((LONG)_GemParBlk.intout[4] << 16) | _GemParBlk.intout[5];
*ratio = ((LONG)_GemParBlk.intout[6] << 16) | _GemParBlk.intout[7];
return _GemParBlk.intout[0];
}